//
// Created by ZLY on 2025/5/14.
//

#ifndef BG_STAR_H
#define BG_STAR_H
#include "../core/object.h"


class BgStar : public Object {
protected:
    std::vector<glm::vec2> star_far_;
    std::vector<glm::vec2> star_mid_;
    std::vector<glm::vec2> star_near_;
    float scale_far_ = 0.2;
    float scale_mid_ = 0.5;
    float scale_near_ = 0.7;
    SDL_FColor color_far_ = {0, 0, 0, 1};
    SDL_FColor color_mid_ = {0, 0, 0, 1};
    SDL_FColor color_near_ = {0, 0, 0, 1};
    float timer_ = 0.0f;
    int num_ = 2000; //每个图层的数量

public:
    static BgStar *addBgStarChild(Object *parent, int num, float scale_far_, float scale_mid_, float scale_near_);
    void update(float dt) override;
    void render() override;
    float getScaleFar() { return scale_far_; }
    float getScaleMid() { return scale_mid_; }
    float getScaleNear() { return scale_near_; }
    void setScaleFar(float scale_far) { scale_far_ = scale_far; }
    void setScaleMid(float scale_mid) { scale_mid_ = scale_mid; }
    void setScaleNear(float scale_near) { scale_near_ = scale_near; }

};


#endif //BG_STAR_H
